package com.hnevc.chenqi;

import java.util.Random;

/**
 *Math类数学操作类（）和Random类（在指定范围内产生的随机数）
 */
public class Example02 {
    public static void main(String[] args) {
        System.out.println("绝对值"+Math.abs(-20));
        System.out.println("求大于参数的最小整数"+Math.ceil(5.6));
        System.out.println("求小于参数的最小整数"+Math.floor(5.6));
        System.out.println("对小数进行四舍五入后的结果"+Math.round(76.56));
        System.out.println("求两个数的较大值"+Math.max(2.15,8.63));
        System.out.println("求两个数的较小值"+Math.min(5.6,9.96));
        System.out.println(Math.random());
        System.out.println(3*3*3*3*3*3*3*3*3);
        Random random =new Random();
        System.out.println(random.nextInt(10));
        Random random1 = new Random(4);
        System.out.println(random1.nextInt(10));
        System.out.println(random1.nextFloat());
    }
}
